package com.song;

/**
 * @Author: shaoyuan
 * @Date: 2024/1/7 16:32
 * @Description:final
 */
public class Test {


    private int age = 12;
    public void outPrint(final int x) {
        //成员内部类
        class InClass {
            public void InPrint() {
                System.out.println(x);  //访问当前局部变量x必须要加final
                System.out.println(age);//访问外部成员变量不需要加final
            }
        }
        new InClass().InPrint();
    }
}
